import type { AppMenuInterface } from '@/api/menu';
import { defineStore } from 'pinia';
import { parse, stringify } from 'zipson/lib';

export const useMenuStore = defineStore(
  'menu',
  () => {
    const menu = ref({} as AppMenuInterface);
    return {
      menu,
    };
  },
  {
    persist: {
      storage: sessionStorage,
      serializer: {
        deserialize: parse,
        serialize: stringify,
      },
    },
  },
);
